package com.unknowpupil.sell.utils;

/**
 * @Classname: MathUtil
 * @Author: <a> w10g </a>
 * @CreateDate: Create in 2020/1/2 12:13
 * @Description:
 * @Version: 1.0
 */
public class MathUtil {
    private static final Double MONEY_RANGE = 0.01;
    /**
     * 功能描述: <br>
     * 〈比较两个金额是否相等〉
     *
     * @param: d1
     * @param: d2
     * @since: 1.0.0
     * @auther: w10g
     * @return:
     * @Date: 2020/1/2 12:15
     */
    public static Boolean equals(Double d1,Double d2){
        Double result = Math.abs(d1-d2);
        if(result<MONEY_RANGE){
            return true;
        }
        else {
            return false;
        }
    }
}
